import axios from '../utils/axios';
/**
 * 登录
 * @returns 
 */
export interface UserLoginReq { account: string; loginName: string, password: string; }
export function userLogin(data: UserLoginReq) {
    return axios<{ token: string; }>({ method: 'post', url: '/user/login', data });
}
/**
 * 获取菜单列表keys
 * @returns 
 */
export type MenuAuth = string[];
export function getMenuAuth() {
    return axios<MenuAuth>({ method: 'get', url: '/user/getMenuAuth' });
}
/**
 * 获取用户列表
 * @returns 
 */
export interface UserRes {
    _id: string;
    account_id: string;
    role_id: string;//角色Id
    roleName: string;//角色名称
    name: string;//用户名
    gender: '男' | '女';//性别
    loginName: string;//登录账号
    email: string;
    phone: string;
    remark: string;
}
export function getUserList() {
    return axios<Array<UserRes>>({ method: 'get', url: '/user/getUserList' });
}
/**
 * 获取角色列表
 * @returns 
 */
export interface RoleRes {
    _id: string;
    name: string;
    state: boolean;
    remark: string;
    creatdTime: string;
    updateTime: string;
    menuAuth: string[];
}
export function getRoleList() {
    return axios<Array<RoleRes>>({ method: 'get', url: '/user/getRoleList' });
}
